package controller 

{	
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	/**
	 * ...
	 * @author Gaz Williams
	 * http://gskinner.com/blog/archives/2006/07/as3_singletons.html
	 * singleton
	 * 
	 * decouples models from viewControllers
	 * 
	 */
	public class EventBus extends EventDispatcher
	{
		
		private static var instance:EventBus;
		public static function getInstance():EventBus
		{
			if (instance == null)
			{
				instance = new EventBus(new SingletonBlocker());
			}
			return instance;
		}
		
		public function EventBus(p_key:SingletonBlocker) 
		{
			if (p_key == null)
			{
				throw new Error("Error: Instantiation failed: Use EventBus.getInstance() instead of new.");
			}
		}
		
		//rest of declaration
		
	}
	
}
internal class SingletonBlocker {}